package org.NooLab.itexx.app.gui.definition;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.HashMap;
import java.util.Map;

import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.JToolBar;
import javax.swing.JTree;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.SoftBevelBorder;


import org.NooLab.itexx.ITexxWindow;
import org.NooLab.itexx.ITexxWindowCommons;
import org.NooLab.itexx.app.controller.ItexxModelController;
import org.NooLab.itexx.app.gui.handlers.CliccCounter;
import org.NooLab.itexx.app.gui.handlers.MainStatusBar;
import org.NooLab.itexx.app.gui.handlers.ResultPanelPopupMenu;
import org.NooLab.itexx.app.gui.handlers.ScrollEventObserverIntf;
import org.NooLab.itexx.app.gui.handlers.TextFieldHandler;
import org.NooLab.itexx.app.gui.handlers.keys.Keyhandlers;

import org.NooLab.itexx.stuctures.RequestFocusContext;
import org.NooLab.itexx.stuctures.RequestItem;

import org.NooLab.utilities.files.DFutils;
import org.NooLab.utilities.gui.FileDrop;
import org.NooLab.utilities.logging.PrintLog;
import org.jdesktop.application.Action;
import org.jdesktop.application.Application;

import com.sun.jna.examples.WindowUtils;

import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
/**
 * 
 * 
*/
public class ITexxWindowGui implements ITexxWindowGuiIntf{

    private JMenuBar menuBar;
    private JPanel jPanelWebMeta;
    private JPanel jPanel4;
    private JPanel jPanelHistoryTree;
    private JPanel jPanelPGraphics;
    private JPanel jPanelFoundTab;
    private JTabbedPane jTabbedPaneMain;
    private JMenuItem jMenuItem_B;
    private JMenuItem MenuPopup1;
    private JPopupMenu ResultPanelsjPopupMenu;
    private JButton Button_status_1;
    private JEditorPane jEditorPaneDummy;
    private JPanel topPanel;
    private JMenuItem jMenuItem7;
    private JMenuItem jMenuItem6;
    private JMenuItem jMenuItem5;
    private JMenuItem jMenuItem4;
    private JMenu editMenu;
    private JMenuItem jMenuItem3;
    private JMenuItem jMenuItem2;
    private JMenuItem jMenuItem1;
    private JMenu fileMenu;
    private JSeparator jSeparator;
    private JToolBar toolBar;
    private JButton newButton;
    private JButton saveButton;
    private JButton openButton;
    private JTextField TextFieldDedicatedSearch;
    private JScrollPane ScrollPaneReturnedResults;
    private JPanel jPanel24;
    private JLayeredPane jLayeredPane2;
    private JButton jButton2;
    private JLayeredPane jLayeredPane1;
    private JButton jButtonSingleWindow;
    private JPanel jPanelToolbarSep1;
    private JPanel jPanelBE;
    private JPanel jPanelBS;
    private JPanel jPanelBN;
    private JPanel jPanelBW;
    private JPanel jPanelScrollDummy;
    private JPanel jPanelScrollWrapFoundStack; // jPanelScrollWrapFoundStack  jPanelScrollWrapFoundStack
    private JPanel jPanelReqHistoryTop;
    private JPanel jPanelToolbarSep2;
    private JPanel jPanelMainStatusBar;
    private JButton jButtonTools;
    private JPanel jPanelToolSep2;
    private JPanel jPanelFocusNormalLabelContainer;
    private Canvas canvasProcessingGraphics;
    private JPanel jPanelGraphicsHost;
    private JPanel jPanel22;
    private JPanel jPanel21;
    private JPanel jPanel20;
    private JPanel jPanel19;
    private JTree jTreeRequestsHistory;
    private JPanel jPanel5;
    private JPanel jPanelFocusNormalBottomN;
    private JTextArea jFocusNormalTextAreaFileDrop;
    private JPanel jPanelFocusNormalFileDropArea;
    private JPanel jPanelFocusNormalBottom;
    
    private JPanel jPanelRibbons;

    private JTextArea jTextAreaFileDrop;
    private JButton ButtonRequestOpenFile;
    private JPanel PanelFileAreaSeparator1;
    private JPanel jPanel18;
    private JPanel jPanel17;
    private JPanel jPanel16;
    private JPanel jPanel15;
    private JPanel jPanelFoundScrollerHost;
    private JPanel jPanel13;
    private JPanel jPanel12;
    private JPanel jPanel11;
    private JPanel PanelReqBottom;
    private JPanel PanelReqRight;
    private JPanel jPanelLeft;
    private JPanel jPanelReqTop;
    private JLabel LabelFocusExplanation3;
    private JLabel LabelFocusExplanation2;
    private JLabel jLabel6;
    private JLabel jLabel5;
    private JButton jButton1;
    private JPanel jPanel10;
    private JLabel jLabel4;
    private JLabel jLabel3;
    private JLabel jLabel2;
    
    private JLabel LabelFocusExplanation;
    private JPanel PanelFocusExplanation;
    private JTextArea TextTolerated;
    private JTextArea TextExclude;
    private JTextArea TextMandatory;
    private JTextArea TextNormal;
    private JPanel jPanel9;
    private JPanel PanelFocusTolerated;
    private JPanel PanelFocusExcludes;
    private JPanel PanelFocusMandatory;
    private JPanel PanelFocusNormal;
    
    private JPanel jPanel8;
    private JPanel jPanel7;
    private JTabbedPane jTabbedPane2;
    private JPanel jPanel6;
    private JPanel PanelFoundControls;
    private JPanel PanelMetaSearchBrowser;
    private JPanel PanelFocus;
    private JPanel PanelRequest;
    private JPanel PanelFound;
    private JPanel GraphicPanel;
    private JPanel toolBarPanel;
    private JPanel contentPanel;
	private JLabel jLabelFocusNormal; 

	Font f14,f13,f16,f11 ;
	
	// ------------------------------------------------------------------------
	
	private ITexxWindowGui app;
	CliccCounter cliccCounter = new CliccCounter();
	
	  
	int scrollbarValue = 0;
	int clics=0;
	
	JFrame mainFrame ;
	
	ITexxWindowCommons appCommons ;
	ITexxWindow texxWindowApp ;
	ITexxWindowGuiFormSettings guiFormSettings ;
	private ItexxModelController itexxModel;
	String[] arguments ;
	private ScrollEventObserverIntf scrollEventObserver;
	Map<Component,BaseColorx> mappedColors = new HashMap<Component,BaseColorx>();
	
	// JPanel appPanel;
	
	public PrintLog out = new PrintLog(2,false) ;
	private Keyhandlers keyHandlers;
	
	// ========================================================================
	public ITexxWindowGui( ITexxWindow texxWindowApp ){// , JFrame mainFrame ){
	
		
		out.setPrefix("[iTexx-Gui]");
		out.print(2, "starting (1) ...");

		this.texxWindowApp = texxWindowApp; 
		this.mainFrame = texxWindowApp.getMainFrame();
		
		// org.jdesktop.application.Application app = org.jdesktop.application.Application.getInstance() ; 
		
		f11 = new Font("Tahoma", 11, 11);
		f13 = new Font("Tahoma", 13, 13);
		f14 = new Font("Tahoma", 14, 14);
		f16 = new Font("Tahoma", 16, 16);
		
	}
	// ========================================================================

	// ------------------------------------------------------------------------
	
	public void setSettingsProvider(ITexxWindowGuiFormSettings guiFormSettings) {
	
		this.guiFormSettings = guiFormSettings;
	}

	public void setScrollEventObserver(ScrollEventObserverIntf scrollEventObserver) {
		// 
		this.scrollEventObserver = scrollEventObserver;
	}

	public void setMainFrame(JFrame frame) {
		// 
		this.mainFrame = frame ;
		app.mainFrame = frame;
	}
	
    public void createITexxWindowGui( ){
    	
		out.setPrefix("[iTexx-Gui]");
											out.print(2, "starting (1) ...");
    	
    	app = this ;
    		
    	itexxModel = new ItexxModelController (texxWindowApp) ;
    	
    	{
    		mainFrame.addComponentListener(new ComponentAdapter() {
    			public void componentResized(ComponentEvent evt) {
    				mainFrameComponentResized(evt);
    			}
    		});
    	}
    	
	    // mainFrame.setUndecorated(false);
    	
    										out.print(2, "starting (2) ...");
        {
            topPanel = new JPanel();
           
            topPanel.setOpaque( false) ; // false = invisible showBasePanel );
            topPanel.setVisible(true);
            topPanel.setBackground(new Color(0.9f,0.4f,0.4f)) ;

            BorderLayout panelLayout = new BorderLayout();
            topPanel.setLayout(panelLayout);
            topPanel.setPreferredSize(new java.awt.Dimension(500, 450));
            topPanel.setMinimumSize(new java.awt.Dimension(300, 450));
            topPanel.setSize(500, 450);
            topPanel.setName("topPanel");
            topPanel.addKeyListener(new KeyAdapter() {
            	public void keyPressed(KeyEvent evt) {
            		topPanelKeyPressed(evt);
            	}
            });

            mainFrame.add(topPanel, BorderLayout.CENTER);
            
            topPanel.addComponentListener(new ComponentAdapter() {
            	public void componentShown(ComponentEvent evt) {
            		TopPanelShown(evt);
            	}
            });

            
            {
                contentPanel = new JPanel();
                BorderLayout contentPanelLayout = new BorderLayout();
                contentPanel.setLayout(contentPanelLayout);

                contentPanel.setOpaque( false) ; // false = invisible showBasePanel );
                contentPanel.setVisible(true);
                contentPanel.setBackground(new Color(0.0f,0.4f,0.8f,0.9f)) ;

                topPanel.add(contentPanel, BorderLayout.CENTER);
                contentPanel.setMinimumSize(new java.awt.Dimension(10, 350));
                contentPanel.setPreferredSize(new java.awt.Dimension(449, 317));
                {
                	jTabbedPaneMain = new JTabbedPane();
                	contentPanel.add(jTabbedPaneMain, BorderLayout.CENTER);
                	contentPanel.add(getJPanelMainStatusBar(), BorderLayout.SOUTH);
                	jTabbedPaneMain.setName("Found");
                	jTabbedPaneMain.setPreferredSize(new java.awt.Dimension(381, 250));
                	jTabbedPaneMain.setMinimumSize(new java.awt.Dimension(5, 50));
                	jTabbedPaneMain.setLocale(new java.util.Locale("de", "CH"));
                	 
                	jTabbedPaneMain.setFont(f14) ;
                	{
                		jPanelFoundTab = new JPanel();
                		
                		jTabbedPaneMain.addTab("   Found   ", null, jPanelFoundTab, null);
                		
                		BorderLayout jPanelFoundTabLayout = new BorderLayout();
                		jPanelFoundTab.setLayout(jPanelFoundTabLayout);
                		jPanelFoundTab.setName("jPanelFoundTab");
                		jPanelFoundTab.setOpaque(false);
                		{
                			PanelFound = new JPanel();
                			BorderLayout PanelFoundLayout = new BorderLayout();
                			PanelFound.setLayout(PanelFoundLayout);
                			jPanelFoundTab.add(PanelFound, BorderLayout.CENTER);
                			PanelFound.setPreferredSize(new java.awt.Dimension(110, 241));
                			{
                				jPanelFoundScrollerHost = new JPanel();
                				BorderLayout jPanelFoundScrollerHostLayout = new BorderLayout();
                				jPanelFoundScrollerHost.setLayout(jPanelFoundScrollerHostLayout);
                				PanelFound.add(jPanelFoundScrollerHost, BorderLayout.CENTER);
                				{	
                				jPanelScrollWrapFoundStack = new JPanel();
                				BoxLayout jPanelScrollWrapFoundStackLayout = new BoxLayout(jPanelScrollWrapFoundStack, javax.swing.BoxLayout.Y_AXIS);
                				jPanelScrollWrapFoundStack.setLayout(jPanelScrollWrapFoundStackLayout);
                				jPanelScrollWrapFoundStack.setSize(422, 536);
                				jPanelScrollWrapFoundStack.setMinimumSize( new Dimension(422,1000));
                				jPanelScrollWrapFoundStack.setPreferredSize(new java.awt.Dimension(10, 500));
                				jPanelScrollWrapFoundStack.setName("jPanelScrollWrapFoundStack");
                				jPanelScrollWrapFoundStack.add(getjPanelScrollDummy());
                				}
                				
                				{
                					ScrollPaneReturnedResults = new JScrollPane();
                					jPanelFoundScrollerHost.add(ScrollPaneReturnedResults, BorderLayout.CENTER);
                					ScrollPaneReturnedResults.setPreferredSize(new java.awt.Dimension(266, 1000));
                					ScrollPaneReturnedResults.setMaximumSize(new java.awt.Dimension(450, 32767));
                					ScrollPaneReturnedResults.setMinimumSize(new java.awt.Dimension(200, 1000));
                					ScrollPaneReturnedResults.setName("ScrollPaneReturnedResults");
                					ScrollPaneReturnedResults.setSize(430, 600);
                					ScrollPaneReturnedResults.getVerticalScrollBar().setMaximumSize(new java.awt.Dimension(15, 32767));
                					ScrollPaneReturnedResults.getVerticalScrollBar().setPreferredSize(new java.awt.Dimension(15, 48));
                					ScrollPaneReturnedResults.getVerticalScrollBar().setOpaque(false);
                					ScrollPaneReturnedResults.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                					ScrollPaneReturnedResults.addPropertyChangeListener(new PropertyChangeListener() {
                						public void propertyChange(PropertyChangeEvent evt) {
                							ScrollPaneReturnedResultsPropertyChange(evt);
                						}
                					});
                					ScrollPaneReturnedResults.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
                						public void adjustmentValueChanged(AdjustmentEvent evt) {
                							verticalScrollBarAdjustmentValueChanged(evt);
                						}
                					});


                					ScrollPaneReturnedResults.setViewportView(getjPanelScrollWrapFoundStack());
                					jPanelScrollWrapFoundStack.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                					jPanelScrollWrapFoundStack.addMouseListener(new MouseAdapter() {
                						public void mouseClicked(MouseEvent evt) {
                							jPanelScrollWrapFoundStackMouseClicked(evt);
                						}
                					});
                				}
                			}

                		} // PanelFound
                		{
                			jPanel15 = new JPanel();
                			jPanelFoundTab.add(jPanel15, BorderLayout.NORTH);
                			jPanel15.setMaximumSize(new java.awt.Dimension(32767, 10));
                		}
                		{
                			jPanel16 = new JPanel();
                			jPanelFoundTab.add(jPanel16, BorderLayout.WEST);
                		}
                		{
                			jPanel17 = new JPanel();
                			jPanelFoundTab.add(jPanel17, BorderLayout.EAST);
                			jPanel17.setPreferredSize(new java.awt.Dimension(60, 221));
                		}
                		{
                			jPanel18 = new JPanel();
                			jPanelFoundTab.add(jPanel18, BorderLayout.SOUTH);
                		}
                		jPanelFoundTab.addComponentListener(new ComponentAdapter() {
                			public void componentResized(ComponentEvent evt) {
                				jPanelFoundTabComponentResized(evt);
                			}
                		});
                	}
                	
                	{
                		jPanelPGraphics = new JPanel();
                		jTabbedPaneMain.addTab("   Graphic   ", null, jPanelPGraphics, null);
                		BorderLayout jPanelPGraphicsLayout = new BorderLayout();
                		jPanelPGraphics.setLayout(jPanelPGraphicsLayout);
                		jPanelPGraphics.setName("jPanelPGraphics");
                		jPanelPGraphics.setVisible(true);
                		jPanelPGraphics.addComponentListener(new ComponentAdapter() {
                			public void componentResized(ComponentEvent evt) {
                				jPanelPGraphicsComponentResized(evt);
                			}
                		});
                		{
                			GraphicPanel = new JPanel();
                			BorderLayout GraphicPanelLayout = new BorderLayout();
                			GraphicPanel.setLayout(GraphicPanelLayout);
                			jPanelPGraphics.add(GraphicPanel, BorderLayout.CENTER);
                			GraphicPanel.setPreferredSize(new java.awt.Dimension(495, 360));
                			{
                				jPanel19 = new JPanel();
                				GraphicPanel.add(jPanel19, BorderLayout.SOUTH);
                				jPanel19.setPreferredSize(new java.awt.Dimension(495, 20));
                			}
                			{
                				jPanel20 = new JPanel();
                				GraphicPanel.add(jPanel20, BorderLayout.EAST);
                			}
                			{
                				jPanel21 = new JPanel();
                				GraphicPanel.add(jPanel21, BorderLayout.WEST);
                				jPanel21.setPreferredSize(new java.awt.Dimension(16, 221));
                			}
                			{
                				jPanel22 = new JPanel();
                				GraphicPanel.add(jPanel22, BorderLayout.NORTH);
                				jPanel22.setPreferredSize(new java.awt.Dimension(495, 17));
                			}
                			{
                				jPanelGraphicsHost = new JPanel();
                				BorderLayout jPanelGraphicsHostLayout = new BorderLayout();
                				jPanelGraphicsHost.setLayout(jPanelGraphicsHostLayout);
                				GraphicPanel.add(jPanelGraphicsHost, BorderLayout.CENTER);
                				{
                					canvasProcessingGraphics = new Canvas();
                					jPanelGraphicsHost.add(canvasProcessingGraphics, BorderLayout.CENTER);
                				}
                			}
                		}
                	}
                	
                	
                	{
                		jPanel4 = new JPanel();
                		jTabbedPaneMain.addTab("   Focus   ", null, jPanel4, null);
                		BorderLayout jPanel4Layout = new BorderLayout();
                		jPanel4.setLayout(jPanel4Layout);
                		jPanel4.setPreferredSize(new java.awt.Dimension(495, 241));
                		jPanel4.setName("jPanel4");
                		jPanel4.addComponentListener(new ComponentAdapter() {
                			public void componentResized(ComponentEvent evt) {
                				jPanel4ComponentResized(evt);
                			}
                		});
                		{
                			PanelFocus = new JPanel();
                			BorderLayout PanelFocusLayout = new BorderLayout();
                			PanelFocus.setLayout(PanelFocusLayout);
                			jPanel4.add(PanelFocus, BorderLayout.CENTER);
                			PanelFocus.setPreferredSize(new java.awt.Dimension(495, 180));
                			PanelFocus.addComponentListener(new ComponentAdapter() {
                				public void componentResized(ComponentEvent evt) {
                					PanelFocusComponentResized(evt);
                				}
                			});
                			{
                				jPanel6 = new JPanel();
                				BorderLayout jPanel6Layout = new BorderLayout();
                				jPanel6.setLayout(jPanel6Layout);
                				PanelFocus.add(jPanel6, BorderLayout.WEST);
                				jPanel6.setPreferredSize(new java.awt.Dimension(472, 339));
                				jPanel6.addComponentListener(new ComponentAdapter() {
                					public void componentResized(ComponentEvent evt) {
                						jPanel6ComponentResized(evt);
                					}
                				});
                				{
                					jTabbedPane2 = new JTabbedPane();
                					jTabbedPane2.setFont(f13) ;
                					jPanel6.add(jTabbedPane2, BorderLayout.CENTER);
                					jTabbedPane2.setPreferredSize(new java.awt.Dimension(409, 198));
                					jTabbedPane2.setName("TabbedPane_FocusParameters");
                					jTabbedPane2.setMaximumSize(new java.awt.Dimension(450, 32767));
                					{
                						PanelFocusNormal = new JPanel();
                						jTabbedPane2.addTab("  normal  ", null, PanelFocusNormal, null);
                						BorderLayout PanelFocusNormalLayout = new BorderLayout();
                						PanelFocusNormal.setLayout(PanelFocusNormalLayout);
                						PanelFocusNormal.setName("PanelFocusNormal");

                						
                						{
                							jPanelFocusNormalBottom = new JPanel();
                							BorderLayout jPanelFocusNormalBottomLayout = new BorderLayout();
                							jPanelFocusNormalBottom.setLayout(jPanelFocusNormalBottomLayout);
                							PanelFocusNormal.add(jPanelFocusNormalBottom, BorderLayout.SOUTH);
                							jPanelFocusNormalBottom.setPreferredSize(new java.awt.Dimension(391, 56));
                							{
                								jPanelFocusNormalFileDropArea = new JPanel();
                								BorderLayout jPanelFocusNormalFileDropAreaLayout = new BorderLayout();
                								jPanelFocusNormalFileDropArea.setLayout(jPanelFocusNormalFileDropAreaLayout);
                								jPanelFocusNormalBottom.add(jPanelFocusNormalFileDropArea, BorderLayout.WEST);
                								jPanelFocusNormalFileDropArea.setPreferredSize(new java.awt.Dimension(343, 25));
                								jPanelFocusNormalFileDropArea.setName("jPanelFocusNormalFileDropArea");
                								{
                									jFocusNormalTextAreaFileDrop = new JTextArea();
                									jPanelFocusNormalFileDropArea.add(jFocusNormalTextAreaFileDrop, BorderLayout.EAST);
                									jFocusNormalTextAreaFileDrop.setName("jFocusNormalTextAreaFileDrop");
                									jFocusNormalTextAreaFileDrop.setPreferredSize(new java.awt.Dimension(295, 25));
                									jFocusNormalTextAreaFileDrop.setText(" drop your file here...");
                									jFocusNormalTextAreaFileDrop.setEditable(false);
                									jFocusNormalTextAreaFileDrop.setBackground(new Color(212, 208, 200));
                									// FIXMEset borderlayout programmatically to CENTER jPanelFocusNormalFileDropArea.
                									
                									jFocusNormalTextAreaFileDrop.addMouseListener(new MouseAdapter() {
                										public void mouseClicked(MouseEvent evt) {
                											clics = jTextAreaFileDropMouseClicked(evt);
                											
                											System.err.println("-----  number of clicks : "+ clics) ;
                											if (clics == 2){
                												jFocusNormalTextAreaFileDrop.setText("");
                											}
                											
                										}
                									});
                									
                									
                									{
                										// System.out, null = no output
                										new FileDrop( null, jFocusNormalTextAreaFileDrop, new FileDrop.Listener() {
                											public void filesDropped(java.io.File[] files) {
                												
                												for (int i = 0; i < files.length; i++) {
                													try {
                														String filename; 
                														filename = files[i].getCanonicalPath();
                														if (DFutils.fileExists(filename)){
                															jFocusNormalTextAreaFileDrop.setText("");
                															jFocusNormalTextAreaFileDrop.append(filename );// + "\n"
                															// trigger action to handle the file
                														}
                														// only if it is indeed a file
                														if (i>=0){ // TODO: make a constant for it, 
                															// it is also dependent on the size of the docs
                															break;
                														}
                													} // end try
                													catch (java.io.IOException e) {
                													}
                												} // end for: through each dropped
                												// file
                											} // end filesDropped
                										}); // end FileDrop.Listener
                										
                									}
                									
                									
                								}
                								{
                									jPanel5 = new JPanel();
                									jPanelFocusNormalFileDropArea.add(jPanel5, BorderLayout.WEST);
                								}
                								
                							}
                							{
                								jPanelFocusNormalLabelContainer = new JPanel();
                								jPanelFocusNormalBottom.add(jPanelFocusNormalLabelContainer, BorderLayout.SOUTH);
                								jPanelFocusNormalLabelContainer.setPreferredSize(new java.awt.Dimension(104, 24));
                								jPanelFocusNormalLabelContainer.setName("jPanelFocusNormalLabelContainer");
                								
                								
                								{
                									jLabelFocusNormal = new JLabel();
                									jPanelFocusNormalLabelContainer.add(jLabelFocusNormal, BorderLayout.SOUTH);
                									jLabelFocusNormal.setName("jLabelNormalExplanation");
                									;
                									jLabelFocusNormal.setPreferredSize(new java.awt.Dimension(391, 21));
                									
                								}
                								
                								
                							}
                							{
                								jPanelFocusNormalBottomN = new JPanel();
                								jPanelFocusNormalBottom.add(jPanelFocusNormalBottomN, BorderLayout.NORTH);
                								jPanelFocusNormalBottomN.setPreferredSize(new java.awt.Dimension(391, 6));
                							}
                						}
                						{
                							TextNormal = new JTextArea();
                							PanelFocusNormal.add(TextNormal, BorderLayout.CENTER);
                							TextNormal.setName("TextNormal");
                							Dimension dFocusText = new java.awt.Dimension(180, 60);
                							TextNormal.setPreferredSize( dFocusText );
                							TextNormal.setSize( dFocusText );
                							TextNormal.setMaximumSize( dFocusText );
                							TextNormal.setLineWrap(true);
                							TextNormal.setWrapStyleWord(true);
                							TextNormal.addKeyListener(new KeyAdapter() {
                								public void keyPressed(KeyEvent evt) {
                									TextNormalKeyPressed(evt);
                								}
                							});
                						}
                					} // TextNormal, TextMandatory, TextExclude, TextTolerated
                					{
                						PanelFocusMandatory = new JPanel();
                						jTabbedPane2.addTab("  mandatory  ", null, PanelFocusMandatory, null);
                						BorderLayout PanelFocusMandatoryLayout = new BorderLayout();
                						PanelFocusMandatory.setLayout(PanelFocusMandatoryLayout);
                						PanelFocusMandatory.setName("PanelFocusMandatory");
                						{
                							TextMandatory = new JTextArea();
                							PanelFocusMandatory.add(TextMandatory, BorderLayout.CENTER);
                							TextMandatory.addKeyListener(new KeyAdapter() {
                								public void keyPressed(KeyEvent evt) {
                									TextMandatoryKeyPressed(evt);
                								}
                							});
                						}
                						{
                							jLabel2 = new JLabel();
                							PanelFocusMandatory.add(jLabel2, BorderLayout.SOUTH);
                							jLabel2.setName("jLabelmandatory");
                							;
                							jLabel2.setPreferredSize(new java.awt.Dimension(391, 21));
                						}
                					}
                					{
                						PanelFocusExcludes = new JPanel();
                						jTabbedPane2.addTab("  excluding  ", null, PanelFocusExcludes, null);
                						BorderLayout PanelFocusExcludesLayout = new BorderLayout();
                						PanelFocusExcludes.setLayout(PanelFocusExcludesLayout);
                						PanelFocusExcludes.setName("PanelFocusExcludes");
                						{
                							TextExclude = new JTextArea();
                							PanelFocusExcludes.add(TextExclude, BorderLayout.CENTER);
                						}
                						{
                							jLabel3 = new JLabel();
                							PanelFocusExcludes.add(jLabel3, BorderLayout.SOUTH);
                							jLabel3.setName("jLabel333");
                							jLabel3.setName("jLabel333");
                						}
                						{
                							jLabel5 = new JLabel();
                							PanelFocusExcludes.add(jLabel5, BorderLayout.SOUTH);
                							jLabel5.setName("jLabel5");
                							jLabel5.setPreferredSize(new java.awt.Dimension(391, 21));
                						}
                					}
                					{
                						PanelFocusTolerated = new JPanel();
                						jTabbedPane2.addTab("  tolerated  ", null, PanelFocusTolerated, null);
                						BorderLayout PanelFocusToleratedLayout = new BorderLayout();
                						PanelFocusTolerated.setLayout(PanelFocusToleratedLayout);
                						PanelFocusTolerated.setName("PanelFocusTolerated");
                						{
                							TextTolerated = new JTextArea();
                							PanelFocusTolerated.add(TextTolerated, BorderLayout.CENTER);
                						}
                						{
                							jLabel4 = new JLabel();
                							PanelFocusTolerated.add(jLabel4, BorderLayout.SOUTH);
                							jLabel4.setName("jLabel4");
                						}
                						{
                							jLabel6 = new JLabel();
                							PanelFocusTolerated.add(jLabel6, BorderLayout.SOUTH);
                							jLabel6.setName("jLabel6");
                							jLabel6.setPreferredSize(new java.awt.Dimension(391, 21));
                						}
                					}
                					jTabbedPane2.addComponentListener(new ComponentAdapter() {
                						public void componentMoved(ComponentEvent evt) {
                							jTabbedPane2ComponentMoved(evt);
                						}
                						public void componentResized(ComponentEvent evt) {
                							jTabbedPane2ComponentResized(evt);
                						}
                					});
                				}
                				{
                					jPanel7 = new JPanel();
                					jPanel6.add(jPanel7, BorderLayout.NORTH);
                					jPanel7.setPreferredSize(new java.awt.Dimension(472, 63));
                					jPanel7.setLayout(null);
                					{
                						LabelFocusExplanation = new JLabel();
                						jPanel7.add(LabelFocusExplanation);
                						LabelFocusExplanation.setName("LabelFocusExplanation");
                						LabelFocusExplanation.setBounds(33, 5, 419, 18);
                						LabelFocusExplanation.setText("Here you may configure a particular focus for your interaction with iTexx.");
                						
                					}
                					{
                						LabelFocusExplanation2 = new JLabel();
                						jPanel7.add(LabelFocusExplanation2);
                						LabelFocusExplanation2.setName("LabelFocusExplanation2");
                						LabelFocusExplanation2.setBounds(33, 20, 406, 21);
                						LabelFocusExplanation2.setText("Note that all items are evaluated singularly.");
                					}
                					{
                						LabelFocusExplanation3 = new JLabel();
                						jPanel7.add(LabelFocusExplanation3);
                						LabelFocusExplanation3.setBounds(33, 39, 399, 14);
                						LabelFocusExplanation3.setName("LabelFocusExplanation3");
                						LabelFocusExplanation3.setText("Enter items separated by commas (,) by semi-colons (;) or by row.");
                					}
                				}
                				{
                					jPanel8 = new JPanel();
                					jPanel6.add(jPanel8, BorderLayout.WEST);
                					jPanel8.setPreferredSize(new java.awt.Dimension(32, 16));
                				}
                				{
                					jPanel9 = new JPanel();
                					jPanel9.setLayout(null);
                					jPanel6.add(jPanel9, BorderLayout.EAST);
                					jPanel9.setPreferredSize(new java.awt.Dimension(44, 275));
                					{
                						jPanel10 = new JPanel();
                						jPanel9.add(jPanel10, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                						jPanel10.setLayout(null);
                						jPanel10.setBounds(10, 24, 34, 86);
                						{
                							jButton1 = new JButton();
                							jPanel10.add(jButton1);
                							jButton1.setBounds(6, 11, 24, 23);
                							jButton1.setName("jButton1");
                						}
                					}
                				}
                				{
                					PanelFocusExplanation = new JPanel();
                					jPanel6.add(PanelFocusExplanation, BorderLayout.SOUTH);
                					PanelFocusExplanation.setPreferredSize(new java.awt.Dimension(347, 24));
                					PanelFocusExplanation.setLayout(null);
                				}
                			}
                		}
                	}
                	{
                		jPanelHistoryTree = new JPanel();
                		jTabbedPaneMain.addTab("   History   ", null, jPanelHistoryTree, null);
                		BorderLayout jPanelHistoryTreeLayout = new BorderLayout();
                		jPanelHistoryTree.setLayout(jPanelHistoryTreeLayout);
                		jPanelHistoryTree.setName("jPanelHistoryTree");
                		jPanelHistoryTree.setVisible(true);
                		
                		jPanelHistoryTree.addComponentListener(new ComponentAdapter() {
                			public void componentResized(ComponentEvent evt) {
                				jPanelHistoryTreeComponentResized(evt);
                			}
                		});
                		
                		jPanelHistoryTree.addKeyListener(new KeyAdapter() {
                			public void keyPressed(KeyEvent evt) {
                				jPanelHistoryTreeKeyPressed(evt);
                			}
                		});
                		
                		{
                			PanelRequest = new JPanel();
                			BorderLayout PanelRequestLayout = new BorderLayout();
                			PanelRequest.setLayout(PanelRequestLayout);
                			jPanelHistoryTree.add(PanelRequest, BorderLayout.CENTER);
                			PanelRequest.setPreferredSize(new java.awt.Dimension(403, 335));
                			{
                				jTreeRequestsHistory = new JTree();
                				PanelRequest.add(jTreeRequestsHistory, BorderLayout.CENTER);
                				PanelRequest.add(getJPanelReqHistoryTop(), BorderLayout.NORTH);
                				jTreeRequestsHistory.setName("jTreeRequestsHistory");
                				jTreeRequestsHistory.setFont(f14) ;
                				jTreeRequestsHistory.setPreferredSize(new java.awt.Dimension(14, 311));
                			}
                		}
                		
                		
                		{
                			jPanelLeft = new JPanel();
                			jPanelHistoryTree.add(jPanelLeft, BorderLayout.WEST);
                			jPanelLeft.setPreferredSize(new java.awt.Dimension(10, 335));
                			jPanelLeft.setMaximumSize(new java.awt.Dimension(10, 32767));
                		}
                		{
                			PanelReqRight = new JPanel();
                			jPanelHistoryTree.add(PanelReqRight, BorderLayout.EAST);
                			PanelReqRight.setPreferredSize(new java.awt.Dimension(60, 335));
                			PanelReqRight.setLayout(null);
                			PanelReqRight.setMinimumSize(new java.awt.Dimension(60, 10));
                			PanelReqRight.setMaximumSize(new java.awt.Dimension(60, 32767));
                		}
                		{
                			PanelReqBottom = new JPanel();
                			jPanelHistoryTree.add(PanelReqBottom, BorderLayout.SOUTH);
                			PanelReqBottom.setPreferredSize(new java.awt.Dimension(487, 24));
                			PanelReqBottom.setMaximumSize(new java.awt.Dimension(32767, 24));
                		}
                	}

                	{
                		jPanelWebMeta = new JPanel();
                		jTabbedPaneMain.addTab("   Meta Items    ", null, jPanelWebMeta, null);
                		BorderLayout jPanelWebMetaLayout = new BorderLayout();
                		jPanelWebMeta.setLayout(jPanelWebMetaLayout);
                		jPanelWebMeta.setName("jPanelWebMeta");
                		jPanelWebMeta.addFocusListener(new FocusAdapter() {
                			public void focusLost(FocusEvent evt) {
                				jPanelWebMetaFocusLost(evt);
                			}
                			public void focusGained(FocusEvent evt) {
                				jPanelWebMetaFocusGained(evt);
                			}
                		});
                		jPanelWebMeta.addMouseWheelListener(new MouseWheelListener() {
                			public void mouseWheelMoved(MouseWheelEvent evt) {
                				jPanelWebMetaMouseWheelMoved(evt);
                			}
                		});
                		jPanelWebMeta.addMouseListener(new MouseAdapter() {
                			public void mouseClicked(MouseEvent evt) {
                				jPanelWebMetaMouseClicked(evt);
                			}
                		});
                		jPanelWebMeta.addKeyListener(new KeyAdapter() {
                			public void keyPressed(KeyEvent evt) {
                				jPanelWebMetaKeyPressed(evt);
                			}
                		});
                		jPanelWebMeta.addComponentListener(new ComponentAdapter() {
                			public void componentResized(ComponentEvent evt) {
                				jPanelWebMetaComponentResized(evt);
                			}
                		});
                		
                		{
                			jPanelReqTop = new JPanel();
                			jPanelWebMeta.add(jPanelReqTop, BorderLayout.NORTH);
                			jPanelReqTop.setPreferredSize(new java.awt.Dimension(495, 99));
                			jPanelReqTop.setLayout(null);
                			jPanelReqTop.setMaximumSize(new java.awt.Dimension(500, 99));
                			jPanelReqTop.setMinimumSize(new java.awt.Dimension(100, 99));
                			{
                				jPanel11 = new JPanel();
                				BorderLayout jPanel11Layout = new BorderLayout();
                				jPanel11.setLayout(jPanel11Layout);
                				jPanelReqTop.add(jPanel11);
                				jPanel11.setBounds(36, 11, 439, 37);
                				{
                					TextFieldDedicatedSearch = new JTextField();
                					jPanel11.add(TextFieldDedicatedSearch, BorderLayout.WEST);
                					TextFieldDedicatedSearch.setName("TextFieldDedicatedSearch");
                					TextFieldDedicatedSearch.setPreferredSize(new java.awt.Dimension(412, 37));
                					TextFieldDedicatedSearch.setText("dedicated classic search...");
                					TextFieldDedicatedSearch.setFont(f16) ;
                					TextFieldDedicatedSearch.setForeground( new Color(222,218,210)) ;
                					TextFieldDedicatedSearch.setMaximumSize(new java.awt.Dimension(2147483647, 32));
                					TextFieldDedicatedSearch.setMinimumSize(new java.awt.Dimension(90, 32));
                					TextFieldDedicatedSearch.setSize(390, 35);
                					TextFieldDedicatedSearch.setLocation(new java.awt.Point(2, 0));
                					TextFieldDedicatedSearch.setMargin(new java.awt.Insets(2, 0, 0, 0));

                					TextFieldDedicatedSearch.addKeyListener(new KeyAdapter() {
                						public void keyReleased(KeyEvent evt) {
                							TextFieldDedicatedSearchKeyReleased(evt);
                						}
                					});
                					
                					TextFieldDedicatedSearch.addMouseListener(new MouseAdapter() {
                						public void mouseClicked(MouseEvent evt) {
                							TextFieldDedicatedSearchMouseClicked(evt);
                						}
                					});

                				}
                				{
                					jPanel13 = new JPanel();
                					jPanel11.add(jPanel13, BorderLayout.EAST);
                					jPanel13.setLayout(null);
                					jPanel13.setBounds(444, 11, 16, 37);
                					jPanel13.setPreferredSize(new java.awt.Dimension(13, 37));
                				}
                			}
                			{
                				jPanel12 = new JPanel();
                				BorderLayout jPanel12Layout = new BorderLayout();
                				jPanel12.setLayout(jPanel12Layout);
                				jPanelReqTop.add(jPanel12);
                				jPanel12.setBounds(36, 54, 447, 44);

                				{
                					PanelFileAreaSeparator1 = new JPanel();
                					PanelFileAreaSeparator1.setLayout(null);
                					jPanel12.add(PanelFileAreaSeparator1, BorderLayout.NORTH);
                					PanelFileAreaSeparator1.setMaximumSize(new java.awt.Dimension(14, 22));
                					PanelFileAreaSeparator1.setMinimumSize(new java.awt.Dimension(1, 22));
                					PanelFileAreaSeparator1.setPreferredSize(new java.awt.Dimension(447, 38));
                					{
                						// jTextAreaFileDrop = new JTextArea();
                						final javax.swing.JTextArea jTextAreaFileDrop = new javax.swing.JTextArea();
                						PanelFileAreaSeparator1.add(jTextAreaFileDrop);
                						jTextAreaFileDrop.setEditable(false);
                						jTextAreaFileDrop.setText(" drop your file here...");
                						jTextAreaFileDrop.setBackground(new Color(212, 208, 200));
                						
                						jTextAreaFileDrop.setName("jTextAreaFileDrop");
                						jTextAreaFileDrop.setMinimumSize(new java.awt.Dimension(200, 40));
                						jTextAreaFileDrop.setMaximumSize(new java.awt.Dimension(400, 40));
                						jTextAreaFileDrop.setBounds(3, 6, 367, 28);

                						jTextAreaFileDrop.addMouseListener(new MouseAdapter() {
                							public void mouseClicked(MouseEvent evt) {
                								clics = jTextAreaFileDropMouseClicked(evt);
                								
                								System.err.println("-----  number of clicks : "+ clics) ;
                								if (clics == 2){
                									jTextAreaFileDrop.setText("");
                								}
                								
                							}
                						});
                						
                						
                						
                						{
                							// System.out, null = no output
                							new FileDrop( null, jTextAreaFileDrop, new FileDrop.Listener() {
                								public void filesDropped(java.io.File[] files) {
                									
                									for (int i = 0; i < files.length; i++) {
                										try {
                											String filename; 
                											filename = files[i].getCanonicalPath();
                											if (DFutils.fileExists(filename)){
                												jTextAreaFileDrop.setText("");
                												jTextAreaFileDrop.append(filename );// + "\n"
                												// trigger action to handle the file
                											}
                											// only if it is indeed a file
                											break;
                										} // end try
                										catch (java.io.IOException e) {
                										}
                									} // end for: through each dropped
                									// file
                								} // end filesDropped
                							}); // end FileDrop.Listener
                							
                						}
                					}
                					{
                						ButtonRequestOpenFile = new JButton();
                						PanelFileAreaSeparator1.add(ButtonRequestOpenFile);
                						PanelFileAreaSeparator1.add(getJPanel24());
                						ButtonRequestOpenFile.setName("ButtonRequestOpenFile");
                						ButtonRequestOpenFile.setPreferredSize(new java.awt.Dimension(35, 31));
                						ButtonRequestOpenFile.setSize(35, 27);
                						ButtonRequestOpenFile.setBounds(376, 5, 35, 31);
                					}
                				}

                			}
                		}
                		
                		// PanelMetaSearchBrowser.setPreferredSize(new java.awt.Dimension(495, 131));
                		 
                		{
                			PanelMetaSearchBrowser = new JPanel();
                			BorderLayout PanelMetaSearchBrowserLayout = new BorderLayout();
                			PanelMetaSearchBrowser.setLayout(PanelMetaSearchBrowserLayout);
                			jPanelWebMeta.add(PanelMetaSearchBrowser, BorderLayout.CENTER);
                			PanelMetaSearchBrowser.setName("PanelMetaSearchBrowser");

                			PanelMetaSearchBrowser.setBackground(new Color(226,208,200));
                			
                    		// PrintLog.Print(2, "jPanelWebMeta stuffing with browser...");
                        	// guiFinisher.getBrowser() ;
                    		// mainFrame.setComponentZOrder( PanelMetaSearchBrowser,999) ;
                		}
                		

                	}
                	jTabbedPaneMain.addComponentListener(new ComponentAdapter() {
                		public void componentResized(ComponentEvent evt) {
                			jTabbedPaneMainComponentResized(evt);
                		}
                	});

                	
                }
            }
            {
                toolBarPanel = new JPanel();
                topPanel.add(toolBarPanel, BorderLayout.NORTH);
                BorderLayout jPanel1Layout = new BorderLayout();
                toolBarPanel.setLayout(jPanel1Layout);
                {
                    jSeparator = new JSeparator();
                    toolBarPanel.add(jSeparator, BorderLayout.SOUTH);
                }
                {
                	toolBar = new JToolBar();
                	toolBarPanel.add(toolBar, BorderLayout.CENTER);
                	{
                		newButton = new JButton();
                		toolBar.add(newButton);
                		newButton.setAction(getAppActionMap().get("newFile"));
                		newButton.setName("ButtonNew");
                		newButton.setFocusable(false);
                		newButton.setPreferredSize(new java.awt.Dimension(48, 44));
                		newButton.setMaximumSize(new java.awt.Dimension(48, 44));
                		newButton.setMinimumSize(new java.awt.Dimension(48, 44));
                		newButton.setBorder(BorderFactory.createTitledBorder(""));
                		newButton.addMouseListener(new MouseAdapter() {
                			public void mouseClicked(MouseEvent evt) {
                				newButtonMouseClicked(evt);
                			}
                		});
                	}
                	{
                		openButton = new JButton();
                		toolBar.add(openButton);
                		openButton.setAction(getAppActionMap().get("open"));
                		openButton.setName("ButtonOpen");
                		openButton.setFocusable(false);
                		openButton.setBorder(BorderFactory.createTitledBorder(""));
                		openButton.setSize(48, 44);
                		openButton.setMinimumSize(new java.awt.Dimension(48, 38));
                		openButton.setPreferredSize(new java.awt.Dimension(48, 44));
                		openButton.setMaximumSize(new java.awt.Dimension(48, 44));
                	}
                	{
                		saveButton = new JButton();
                		toolBar.add(saveButton);
                		toolBar.add(getJPanelToolbarSep1());
                		toolBar.add(getJButtonSingleWindow());
                		saveButton.setAction(getAppActionMap().get("save"));
                		saveButton.setName("ButtonSave");
                		saveButton.setFocusable(false);
                		saveButton.setBorder(BorderFactory.createTitledBorder(""));
                		saveButton.setMaximumSize(new java.awt.Dimension(48, 44));
                		saveButton.setMinimumSize(new java.awt.Dimension(48, 44));
                		saveButton.setPreferredSize(new java.awt.Dimension(48, 44));
                		saveButton.setSize(48, 44);
                	}
                }
            }
        }
        menuBar = new JMenuBar();
        menuBar.setVisible(false);
        {
            fileMenu = new JMenu();
            menuBar.add(fileMenu);
            fileMenu.setName("fileMenu");
        {
                jMenuItem1 = new JMenuItem();
                fileMenu.add(jMenuItem1);
                jMenuItem1.setAction(getAppActionMap().get("newFile"));
            }
            {
                jMenuItem2 = new JMenuItem();
                fileMenu.add(jMenuItem2);
                jMenuItem2.setAction(getAppActionMap().get("open"));
            }
            {
                jMenuItem3 = new JMenuItem();
                fileMenu.add(jMenuItem3);
                jMenuItem3.setAction(getAppActionMap().get("save"));
            }
        }
        {
            editMenu = new JMenu();
            menuBar.add(editMenu);
            editMenu.setName("editMenu");
        {
                jMenuItem4 = new JMenuItem();
                editMenu.add(jMenuItem4);
                jMenuItem4.setAction(getAppActionMap().get("copy"));
            }
            {
                jMenuItem5 = new JMenuItem();
                editMenu.add(jMenuItem5);
                jMenuItem5.setAction(getAppActionMap().get("cut"));
            }
            {
                jMenuItem6 = new JMenuItem();
                editMenu.add(jMenuItem6);
                jMenuItem6.setAction(getAppActionMap().get("paste"));
            }
            {
                jMenuItem7 = new JMenuItem();
                editMenu.add(jMenuItem7);
                jMenuItem7.setAction(getAppActionMap().get("delete"));
            }
        }
        mainFrame.setJMenuBar(menuBar);
        menuBar.setName("menuBar");
        topPanel.validate() ;
        
        									out.print(2, "starting (3) ...");
        _browserPrepare();
        									out.print(2, "starting (4) ...");
       
        
    }

    private void _browserPrepare(){
	    // UIUtils.setPreferredLookAndFeel();
	    
	    
	    SwingUtilities.invokeLater(
	    new Runnable() {
	    				public void run() {
	    						mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	    								// not for context ITexxWinApp
	    								//app.getjPanelWebMeta().add(new ITexxWebBrowser(0), BorderLayout.CENTER);
	    								// we may navigate only from within main Swing thread !!!
	    						}
	    				});
	    

    }
    
    public ITexxWindowGuiFormSettings getGuiFormSettings() {
		return guiFormSettings;
	}

	@Action
	public void open() {
    	// Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
    	
    }

	@Action
	public void save() {
	}

	@Action
	public void newFile() {
	}

	private ActionMap getAppActionMap() {
	    return Application.getInstance().getContext().getActionMap(this);
	}

	
	/**
	 *
	 * here we create a JPanel to the scrollpane 
	 * @param foundString a html formatted string, possibly with inline style
	 */
	public void addFoundEntryPanel(String foundString){
		
	}
	
	
	public void mainFrameComponentResized(ComponentEvent evt) {
    	out.print(2, "getMainFrame().componentResized, event="+evt);
    	
    	try{

        	JWebBrowser jwb = this.appCommons.getHostList().get(0).getWebBrowser();
        	jwb.repaint() ;
        	jwb.validate();

    	}catch(Exception e){
    	}
    }
    
    private void jTabbedPaneMainComponentResized(ComponentEvent evt) {
    	// out.print(2, "jTabbedPaneMain.componentResized, event="+evt);
    	
    }
    
    private void jPanelFoundTabComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanelFoundTab.componentResized, event="+evt);
    	
    }
    
    private void newButtonMouseClicked(MouseEvent evt) {
    	out.print(2, "newButton.mouseClicked, event="+evt);
    	
    }
    
    public JPanel getPanelFoundControls() {
    	return PanelFoundControls;
    }
    
    private void jPanel6ComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanel6.componentResized, event="+evt);
    	
    }
    
    private void jTabbedPane2ComponentResized(ComponentEvent evt) {
    	// out.print(2, "jTabbedPane2.componentResized, event="+evt);

    }
    
    private void jTabbedPane2ComponentMoved(ComponentEvent evt) {
    	out.print(2, "jTabbedPane2.componentMoved, event="+evt);
    	// 
    }
    
    public JTextArea getTextNormal() {
    	return TextNormal;
    }
    
    private void jPanel4ComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanel4.componentResized, event="+evt);
    
    }
    
    private void jPanelWebMetaComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanelWebMeta.componentResized, event="+evt);
    	//
    	// Dimension d = jPanelWebMeta.getSize();
		// PanelMetaSearchBrowser.setPreferredSize(new java.awt.Dimension(0, 0));
    	// PanelMetaSearchBrowser.setSize(new java.awt.Dimension( d.width , d.height));
    	/*
		Component[] cs = jPanelWebMeta.getComponents() ;
		for (int i=0;i<cs.length;i++){
			String str = cs[i].getName() ;
			if (str==null){
				str = cs[i].toString() ;
			}
			out.printErr(2, " :: jPanelWebMeta ("+(i)+") " + str );
		}
		*/
    }
    
    private void jPanelHistoryTreeComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanelHistoryTree.componentResized, event="+evt);
    	
    }
    
    private void jPanelPGraphicsComponentResized(ComponentEvent evt) {
    	// out.print(2, "jPanel2.componentResized, event="+evt);
    	
    }
    
    

	private void TextFieldDedicatedSearchMouseClicked(MouseEvent evt) {
		System.err.println("TextFieldDedicatedSearch.mouseClicked, event="+evt);
	
		String str = TextFieldDedicatedSearch.getText() ;
		if (str.toLowerCase().endsWith("...")){
			TextFieldDedicatedSearch.setText("") ;
			TextFieldDedicatedSearch.setForeground( Color.BLACK) ;
			TextFieldDedicatedSearch.repaint() ;
		}
	}

	private void TextFieldDedicatedSearchKeyReleased(KeyEvent evt) {
		out.print(4,"TextFieldDedicatedSearch.keyReleased, event="+evt);
		// String str = TextFieldDedicatedSearch.getText() ;
		
		// neatly outsourced into a separate object
		(new TextFieldHandler(app, TextFieldDedicatedSearch)).handling( evt );
		
	}

	
	// click to filedrop area
	private int jTextAreaFileDropMouseClicked(MouseEvent evt) {
		int clics = 0;
		out.print(2, "jTextAreaFileDrop.mouseClicked, event="+evt);
		/*
		 * measure time between two occurrences, using a dedicated object, which gets deleted if the second click occurs
		 * (and auto-delete after maxPeriod)
		 */
	
		clics = cliccCounter.detect( jTextAreaFileDrop ) ;
		
		
		int meModifiers = evt.getModifiers();
		out.print(2, "    jTextAreaFileDrop.mouseClicked, event modifiers value "+meModifiers);
		if ((evt.getModifiers() & InputEvent.BUTTON1_DOWN_MASK) == 0){
			
		}

		return clics;
	}
	

	
	// the Request panel... we use it to detect Ctrl for detecting ctrl-click
	private void jPanelHistoryTreeKeyPressed(KeyEvent evt) {
		out.print(2, "jPanelHistoryTree.keyPressed, event="+evt);
		
	}

	
	private void TopPanelShown(ComponentEvent evt) {
		
		out.printErr(2,  "jPanelWebMeta stuffing with browser...");

	}
	
	 
	public JPanel getjPanelWebMeta() {
		return jPanelWebMeta;
	}

	public ITexxWindowGui getApp() {
		return app;
	}
	
	public JTextArea getJFocusNormalTextAreaFileDrop() {
		return jFocusNormalTextAreaFileDrop;
	}

	
	public RequestItem prepareRequestItem( String rqStr ) {
		
		return prepareRequestItem( rqStr, "",null,false,false); 
				
	}
	
	private RequestItem prepareRequestItem( String rqStr, String filename,
											RequestFocusContext focus, 
											boolean fullrequest, boolean filecontext) {
		RequestItem requestItem;
		requestItem = new RequestItem();
		
		if (focus==null){
			focus = itexxModel.getRequestFocusContext();
		}
		if ((focus!=null) && (focus.isActive()) && (fullrequest)){
			requestItem.setFocusContext( focus );
		}
		

		if (filecontext){
			// this is NOT the background as given in "focus", it is a dedicated search for the cntent in that file
			requestItem.setFileContextTemplate(filename);
		}
		requestItem.setRequestStr(rqStr) ;
		
		
		return requestItem;
	}

	public ItexxModelController getItexxModel() {
		
		return itexxModel ;
	}
	
	

	public JPanel getJPanelMainStatusBar() {
		if(jPanelMainStatusBar == null) {
			jPanelMainStatusBar = new JPanel();
			jPanelMainStatusBar.setPreferredSize(new java.awt.Dimension(500, 29));
			jPanelMainStatusBar.setMaximumSize(new java.awt.Dimension(32767, 29));
			jPanelMainStatusBar.setMinimumSize(new java.awt.Dimension(10, 29));
			jPanelMainStatusBar.setSize(449, 29);
			jPanelMainStatusBar.setLayout(null);
			jPanelMainStatusBar.add(getButton_status_1());
		}
		return jPanelMainStatusBar;
	}
	

	public JPanel getPanelMetaSearchBrowser() {
		return PanelMetaSearchBrowser;
	}


	public void setAppCommons(ITexxWindowCommons appcommons) {
		
		appCommons = appcommons;
	}
	
	private JPanel getJPanelReqHistoryTop() {
		if(jPanelReqHistoryTop == null) {
			jPanelReqHistoryTop = new JPanel();
			jPanelReqHistoryTop.setMaximumSize(new java.awt.Dimension(32767, 10));
		}
		return jPanelReqHistoryTop;
	}
	
	public JPanel getjPanelScrollWrapFoundStack() {
		if(jPanelScrollWrapFoundStack == null) {
			jPanelScrollWrapFoundStack = new JPanel();
			BoxLayout jPanelScrollWrapFoundStackLayout = new BoxLayout(jPanelScrollWrapFoundStack, javax.swing.BoxLayout.Y_AXIS);
			jPanelScrollWrapFoundStack.setLayout(jPanelScrollWrapFoundStackLayout);
			jPanelScrollWrapFoundStack.setSize(422, 836);
			jPanelScrollWrapFoundStack.setMinimumSize(new java.awt.Dimension(422, 1000));
			jPanelScrollWrapFoundStack.setPreferredSize(new java.awt.Dimension(10, 800));
			jPanelScrollWrapFoundStack.setName("jPanelScrollWrapFoundStack");
			jPanelScrollWrapFoundStack.add(getjPanelScrollDummy());
		}
		return jPanelScrollWrapFoundStack;
	}
	
	
	JPanel getjPanelScrollDummy() {
		if(jPanelScrollDummy == null) {
			jPanelScrollDummy = new JPanel();
			BorderLayout jPanelScrollDummyLayout = new BorderLayout();
			jPanelScrollDummy.setLayout(jPanelScrollDummyLayout);
			jPanelScrollDummy.setSize(403, 150);
			jPanelScrollDummy.setMaximumSize(new java.awt.Dimension(32767, 150));
			jPanelScrollDummy.setPreferredSize(new java.awt.Dimension(10, 150));
			jPanelScrollDummy.setName("jPanelScrollDummy");
			jPanelScrollDummy.add(getJPanelBW(), BorderLayout.WEST);
			jPanelScrollDummy.add(getJPanelBN(), BorderLayout.NORTH);
			jPanelScrollDummy.add(getJPanelBS(), BorderLayout.SOUTH);
			jPanelScrollDummy.add(getJPanelBE(), BorderLayout.EAST);
			jPanelScrollDummy.add(getJEditorPaneDummy(), BorderLayout.CENTER);
			setComponentPopupMenu(jPanelScrollDummy, getResultPanelsjPopupMenu());

		}
		return jPanelScrollDummy;
	}

	private JPanel getJPanelBW() {
		if(jPanelBW == null) {
			jPanelBW = new JPanel();
			jPanelBW.setMaximumSize(new java.awt.Dimension(4, 32767));
			jPanelBW.setPreferredSize(new java.awt.Dimension(4, 144));
			jPanelBW.setMinimumSize(new java.awt.Dimension(4, 80));
			jPanelBW.setName("jPanelBW");
		}
		return jPanelBW;
	}
	
	private JPanel getJPanelBN() {
		if(jPanelBN == null) {
			jPanelBN = new JPanel();
			jPanelBN.setPreferredSize(new java.awt.Dimension(409, 4));
			jPanelBN.setMinimumSize(new java.awt.Dimension(100, 4));
			jPanelBN.setMaximumSize(new java.awt.Dimension(32767, 4));
			jPanelBN.setName("jPanelBN");
		}
		return jPanelBN;
	}
	
	private JPanel getJPanelBS() {
		if(jPanelBS == null) {
			jPanelBS = new JPanel();
			jPanelBS.setPreferredSize(new java.awt.Dimension(100, 4));
			jPanelBS.setMinimumSize(new java.awt.Dimension(100, 4));
			jPanelBS.setMaximumSize(new java.awt.Dimension(32767, 4));
			jPanelBS.setName("jPanelBS");
		}
		return jPanelBS;
	}
	
	private JPanel getJPanelBE() {
		if(jPanelBE == null) {
			jPanelBE = new JPanel();
			jPanelBE.setMinimumSize(new java.awt.Dimension(4, 80));
			jPanelBE.setPreferredSize(new java.awt.Dimension(6, 144));
			jPanelBE.setMaximumSize(new java.awt.Dimension(6, 32767));
			jPanelBE.setName("jPanelBE");
			jPanelBE.setSize(6, 142);
		}
		return jPanelBE;
	}
	
	private JPanel getJPanel24() {
		if(jPanel24 == null) {
			jPanel24 = new JPanel();
			jPanel24.setPreferredSize(new java.awt.Dimension(28, 27));
			jPanel24.setLayout(null);
			jPanel24.setBounds(416, 7, 28, 27);
		}
		return jPanel24;
	}
	
	private JPanel getJPanelToolbarSep1() {
		if(jPanelToolbarSep1 == null) {
			jPanelToolbarSep1 = new JPanel();
			jPanelToolbarSep1.setPreferredSize(new java.awt.Dimension(48, 37));
			jPanelToolbarSep1.setMaximumSize(new java.awt.Dimension(355, 37));
			jPanelToolbarSep1.setMinimumSize(new java.awt.Dimension(55, 37));
		}
		return jPanelToolbarSep1;
	}
	
	private JButton getJButtonSingleWindow() {
		if(jButtonSingleWindow == null) {
			jButtonSingleWindow = new JButton();
			jButtonSingleWindow.setName("jButtonSingleWindow");
			jButtonSingleWindow.setBorder(BorderFactory.createTitledBorder(""));
			jButtonSingleWindow.setPreferredSize(new java.awt.Dimension(48, 44));
			jButtonSingleWindow.setMaximumSize(new java.awt.Dimension(48, 44));
			jButtonSingleWindow.setMinimumSize(new java.awt.Dimension(48, 44));
			jButtonSingleWindow.addKeyListener(new KeyAdapter() {
				public void keyPressed(KeyEvent evt) {
					jButtonSingleWindowKeyPressed(evt);
				}
			});
			jButtonSingleWindow.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					jButtonSingleWindowMouseClicked(evt);
				}
			});
		}
		return jButtonSingleWindow;
	}
	

	public JButton getjButtonSingleWindow() {
		return jButtonSingleWindow;
	}

	private JButton getJButton2() {
		if(jButton2 == null) {
			jButton2 = new JButton();
			jButton2.setName("jButton2");
			jButton2.setBounds(-266, 0, 132, 93);
		}
		return jButton2;
	}

	public JPanel getjPanelHistoryTree() {
		return jPanelHistoryTree;
	}

	public JPanel getjPanelPGraphics() {
		return jPanelPGraphics;
	}

	public JTabbedPane getTabbedPaneMain() {
		return jTabbedPaneMain;
	}

	public JTextArea getTextTolerated() {
		return TextTolerated;
	}

	public void setTextTolerated(JTextArea textTolerated) {
		TextTolerated = textTolerated;
	}

	public JTextArea getTextExclude() {
		return TextExclude;
	}

	public void setTextExclude(JTextArea textExclude) {
		TextExclude = textExclude;
	}

	public JTextArea getTextMandatory() {
		return TextMandatory;
	}

	public void setTextMandatory(JTextArea textMandatory) {
		TextMandatory = textMandatory;
	}

	public void setTextNormal(JTextArea textNormal) {
		TextNormal = textNormal;
	}

	public JButton getNewButton() {
		return newButton;
	}

	public JButton getSaveButton() {
		return saveButton;
	}

	public JButton getOpenButton() {
		return openButton;
	}

	public JScrollPane getScrollPaneReturnedResults() {
		return ScrollPaneReturnedResults;
	}

	public JPanel getjPanelFoundScrollerHost() {
		return jPanelFoundScrollerHost;
	}
	
	
	
	private void verticalScrollBarAdjustmentValueChanged(AdjustmentEvent evt) {
		// System.out.println("ScrollPane adjustmentValueChanged, event="+evt.getValue() );
		//
		// 
		scrollbarValue = evt.getValue() ;
		if (scrollEventObserver!=null){
			scrollEventObserver.setValue( evt.getValue() );
		}
	}

	public int getScrollbarValue() {
		return scrollbarValue;
	}

	public void setScrollbarValue(int scrollbarValue) {
		this.scrollbarValue = scrollbarValue;
	}
	
	private JEditorPane getJEditorPaneDummy() {
		if(jEditorPaneDummy == null) {
			jEditorPaneDummy = new JEditorPane();
			jEditorPaneDummy.setName("jEditorPaneDummy");
			jEditorPaneDummy.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					jEditorPaneDummyMouseClicked(evt);
				}
				public void mouseExited(MouseEvent evt) {
					jEditorPaneDummyMouseExited(evt);
				}
				public void mouseEntered(MouseEvent evt) {
					jEditorPaneDummyMouseEntered(evt);
				}
			});
		}
		return jEditorPaneDummy;
	}
	
	public JFrame getMainFrame() {
		return mainFrame;
	}

	public ITexxWindow getTexxWindowApp() {
		return texxWindowApp;
	}

	public JPanel getTopPanel() {
		return topPanel;
	}

	public JPanel getPanelFound() {
		return PanelFound;
	}

	public JPanel getPanelFoundTab() {
		return jPanelFoundTab;
	}

	public JToolBar getToolBar() {
		return toolBar;
	}

	public JPanel getContentPanel() {
		return contentPanel;
	}

	private void jEditorPaneDummyMouseEntered(MouseEvent evt) {
		System.out.println("jEditorPaneDummy.mouseEntered, event="+evt);
	}
	
	private void jEditorPaneDummyMouseExited(MouseEvent evt) {
		System.out.println("jEditorPaneDummy.mouseExited, event="+evt);
	}
	
	private void jEditorPaneDummyMouseClicked(MouseEvent evt) {
		System.out.println("jEditorPaneDummy.mouseClicked, event="+evt);
	}
	
	private void topPanelKeyPressed(KeyEvent evt) {
		System.out.println("topPanel.keyPressed, event="+evt);

	}
	
	private void jButtonSingleWindowMouseClicked(MouseEvent evt) {
		System.out.println("jButtonSingleWindow.mouseClicked, event="+evt);
		// if we see the button and click to it, we are always in decorated view!
		appCommons.toggleAppWindowState(false);
	}
	
	private void jButtonSingleWindowKeyPressed(KeyEvent evt) {
		System.out.println("jButtonSingleWindow.keyPressed, event="+evt);
	}
	
	private void jPanelWebMetaKeyPressed(KeyEvent evt) {
		System.out.println("jPanelWebMeta.keyPressed, event="+evt);
	}
	
	private void jPanelWebMetaMouseClicked(MouseEvent evt) {
		System.out.println("jPanelWebMeta.mouseClicked, event="+evt);
	}
	
	private void jPanelWebMetaMouseWheelMoved(MouseWheelEvent evt) {
		System.out.println("jPanelWebMeta.mouseWheelMoved, event="+evt);
	}
	
	private void jPanelWebMetaFocusGained(FocusEvent evt) {
		System.out.println("jPanelWebMeta.focusGained, event="+evt);
	}
	
	private void jPanelWebMetaFocusLost(FocusEvent evt) {
		System.out.println("jPanelWebMeta.focusLost, event="+evt);
	}

	@Override
	public PrintLog getOut() {
		// 
		return out;
	}

	@Override
	public Color getMappedColor(JComponent component, float transparency) {
		Color color = new Color(0.6f,0.6f,0.6f,1f);
		float t = transparency;
		
		if (mappedColors.containsKey(component)){
			BaseColorx _bc = mappedColors.get(component);
			if (t<0){
				t = _bc.getTransparency() ;
			}
			color = new Color( _bc.colorChannels[0],_bc.colorChannels[1],_bc.colorChannels[2], t) ;	
		}
		 
		return color;
	}

	@Override
	public void setMappedColor(JComponent component, float[] colorChannels) {
	}

	@Override
	public Color getMappedColor(JComponent component) {
		// 
		return getMappedColor(component, -1) ;
	}

	
	public Keyhandlers getKeyHandlers() {
		// 
		return keyHandlers;
	}

	@Override
	public void relocateFoundItemsPanel(int flag) {
		//
		
	}

	@Override
	public boolean isSimpleWindow() {
		//
		return false;
	}
	
	private void appPanelComponentResized(ComponentEvent evt) {
		System.out.println("appPanel.componentResized, event="+evt);
		//
	}
	
	private void PanelFocusComponentResized(ComponentEvent evt) {
		System.out.println("PanelFocus.componentResized, event="+evt);
		//
	}
	
	private void ScrollPaneReturnedResultsPropertyChange(PropertyChangeEvent evt) {
		System.out.println("ScrollPaneReturnedResults.propertyChange, event="+evt);
		//
	}

	@Override
	public JToolBar getMainToolBar() {

		return toolBar;
	}

	@Override
	public JTextField getTextFieldDedicatedSearch() {
		return TextFieldDedicatedSearch;
	}

	@Override
	public JTextArea getFocusNormalTextAreaFileDrop() {
		// 
		return jFocusNormalTextAreaFileDrop;
	}
	
	private void TextNormalKeyPressed(KeyEvent evt) {
		System.out.println("TextNormal.keyPressed, event="+evt);
		//TODO add your code for TextNormal.keyPressed
	}
	
	private void TextMandatoryKeyPressed(KeyEvent evt) {
		System.out.println("TextMandatory.keyPressed, event="+evt);
		//TODO add your code for TextMandatory.keyPressed
	}
	
	private void jPanelScrollWrapFoundStackMouseClicked(MouseEvent evt) {
		System.out.println("jPanelScrollWrapFoundStack.mouseClicked, event="+evt);
		//TODO add your code for jPanelScrollWrapFoundStack.mouseClicked
	}

	@Override
	public void showResultPanelPopup(int panelIndex) {
		// TODO Auto-generated method stub
		
	}
	
	private JButton getButton_status_1() {
		if(Button_status_1 == null) {
			Button_status_1 = new JButton();
			Button_status_1.setBounds(455, 1, 31, 28);
			Button_status_1.setPreferredSize(new java.awt.Dimension(29, 28));
			Button_status_1.setSize(29, 28);
			Button_status_1.setName("Button_status_1");
			Button_status_1.setMaximumSize(new java.awt.Dimension(29, 28));
			Button_status_1.setMinimumSize(new java.awt.Dimension(29, 28));
			Button_status_1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
			
			Button_status_1.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					Button_status_1MouseClicked(evt);
				}
			});
		}
		return Button_status_1;
	}
	
	private void Button_status_1MouseClicked(MouseEvent evt) {
		System.out.println("Button_status_1.mouseClicked, event="+evt);
		//TODO add your code for Button_status_1.mouseClicked
	}

	@Override
	public void setLastClickedPhysicalPanel(int panelIndex) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int getLastClickedPhysicalPanel() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public MainStatusBar getMainStatusBar() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public JPopupMenu getResultPanelsjPopupMenu() {
		if(ResultPanelsjPopupMenu == null) {
			ResultPanelsjPopupMenu = new JPopupMenu();
			ResultPanelsjPopupMenu.add(getMenuPopup1());
			ResultPanelsjPopupMenu.add(getJMenuItem_B());
		}
		return ResultPanelsjPopupMenu;
	}
	
	/**
	* Auto-generated method for setting the popup menu for a component
	*/
	private void setComponentPopupMenu(final java.awt.Component parent, final javax.swing.JPopupMenu menu) {
		parent.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent e) {
				if(e.isPopupTrigger())
					menu.show(parent, e.getX(), e.getY());
			}
			public void mouseReleased(java.awt.event.MouseEvent e) {
				if(e.isPopupTrigger())
					menu.show(parent, e.getX(), e.getY());
			}
		});
	}
	
	private JMenuItem getMenuPopup1() {
		if(MenuPopup1 == null) {
			MenuPopup1 = new JMenuItem();
			MenuPopup1.setName("MenuPopup1");
			MenuPopup1.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					MenuPopup1MouseClicked(evt);
				}
			});
		}
		return MenuPopup1;
	}
	
	private JMenuItem getJMenuItem_B() {
		if(jMenuItem_B == null) {
			jMenuItem_B = new JMenuItem();
			jMenuItem_B.setName("jMenuItem_B");
			jMenuItem_B.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					jMenuItem_BMouseClicked(evt);
				}
			});
		}
		return jMenuItem_B;
	}
	
	private void jMenuItem_BMouseClicked(MouseEvent evt) {
		System.out.println("jMenuItem_B.mouseClicked, event="+evt);
		//TODO add your code for jMenuItem_B.mouseClicked
	}
	
	private void MenuPopup1MouseClicked(MouseEvent evt) {
		System.out.println("MenuPopup1.mouseClicked, event="+evt);
		//TODO add your code for MenuPopup1.mouseClicked
	}

	@Override
	public ResultPanelPopupMenu getResultPanelPopupMenu() {
		// TODO Auto-generated method stub
		return null;
	}

}



class BaseColorx{
	
	float[] colorChannels = new float[4];
	
	public BaseColorx( float[] colorchannels ){
		colorChannels[3]  =-1f;
		
		colorChannels[0]  = colorchannels[0];
		colorChannels[1]  = colorchannels[1];
		colorChannels[2]  = colorchannels[2];
		if (colorchannels.length>3){
			colorChannels[3]  = colorchannels[3];
		}
	}

	public float getTransparency() {
		float t = 1f;
		
		if ((colorChannels.length>=4) && (colorChannels[3]>=0.0)){
			t = colorChannels[3];
		}
		return t;
	}
	
}